using UnityEngine;
using System.Collections;

public class ConeEndCollider : MonoBehaviour {

    private Enemy _enemy;

	// Use this for initialization
	void Start () {
        _enemy = this.transform.parent.GetComponent<Enemy>();
	}

    //Trap Collider
    void OnTriggerStay(Collider obj)
    {

        if (obj.gameObject.layer == Const.LAYER_TRAP)
        {
            Const.TRAP_TYPE typeTrap = obj.GetComponent<Trap>().typeTrap;

            switch (typeTrap)
            {
                case Const.TRAP_TYPE.BILLE:
                    _enemy.ShowTrap(obj.gameObject);
                    break;

                case Const.TRAP_TYPE.FIRECRACKER:
                    _enemy.ShowTrap(obj.gameObject);
                    break;
            }
        }
    }

}
